<template>
    <div class="save" >
        <div class="left" >
            <el-scrollbar class="left-scrol">
                <SaveItem  :data="saveList" @delete="deletefilter"/>
                <!-- <ComItem v-if="screenData.length > 0"  :data="screenData" @del="del" @copy="copy" @lock="lock" @cancel="cancel"/>
                <div v-else class="noti">暂时没有保存的方案</div> -->
            </el-scrollbar>
        </div>
        <div class="right">
            <el-scrollbar class="left-scrol">
            </el-scrollbar>
        </div>
    </div>
</template>
<script setup>
import { ElMessage } from 'element-plus'
import { http } from '@/utils/f-http'
import SaveItem from './components/SaveItem.vue';
const saveList = ref([])
const listpage = {
    page: 1,
    page_size: 40,
    total: 0
}
const getfilterlist = () => {
    http.get(`/filter/filter_list?page=${listpage.page}&page_size=${listpage.page_size}`).then(res => {
        // state.listpage.total = res.data.total
        saveList.value = res.data.list
        console.log(saveList.value);
    })
}

const deletefilter = (item) => {
    http.delete(`/filter/delete_filter?filter_obj_code=${item}`).then(res => {
        ElMessage({
            message: res.msg,
            type: 'success',
        })
        getfilterlist()
    })

}

onMounted(() =>{
    getfilterlist()
})
</script>
<style lang='scss' scoped>
.save{
    // height: 724px;
    // width: 330px;
    height: calc(100vh - 160px);
    margin: 16px 0 0 0;
    display: flex;
    // justify-content: center;
}
.left-scrol{
    height: 100%;
}
.left{
    width: 330px;
}
</style>